package baseUserService

import (
	"learn/app/models/baseUserModel"
	"learn/app/services/cs"
)

type Menu struct {
	cs.BaseService
}

func (obj *Menu) Add(param map[string]interface{}) (bool, uint64) {
	inserId := new(baseUserModel.Menu).Add(param)
	if inserId == 0 {
		return false, inserId
	}
	return true, inserId
}

func (obj *Menu) List() ([]map[string]interface{}, int64) {

	list, count := new(baseUserModel.Menu).List()
	n := make(map[string]string)
	n["1"] = "测试"
	return obj.HasFile("menu_name").
		AddStatusName("status_name", "status", cs.StateKG).
		DealMap(list), count
	//return list, count
}

func (obj *Menu) Update(param map[string]interface{}) (bool, uint64) {

	inserId := new(baseUserModel.Menu).Update(param)
	if inserId == 0 {
		return false, inserId
	}
	return true, inserId
}

func (obj *Menu) Del(param map[string]interface{}) (bool, uint64) {
	inserId := new(baseUserModel.Menu).Del(param)
	if inserId == 0 {
		return false, inserId
	}
	return true, inserId
}
